package com.fulihui.weixinclient.request;

import com.alibaba.fastjson.JSON;
import com.fulihui.weixinclient.http.HttpMethodEnum;
import com.fulihui.weixinclient.result.QRCodeTicketWeixinResult;

/**
 * 创建二维码消息票据消息请求对象
 * 
 * @author leeson 2015年10月29日 下午4:41:49
 *
 */
public class QRCodeTicketWeixinRequest extends WeixinJsonRequest<QRCodeTicketWeixinResult> {
    private static final long serialVersionUID = 8327975022238701790L;

    private String            access_token;

    private String            body;

    @Override
    protected void childParam() {
        addParam("access_token", access_token);
    }

    @Override
    public String service() {
        return "https://api.weixin.qq.com/cgi-bin/qrcode/create";
    }

    @Override
    public String urlEndStr() {
        return null;
    }

    @Override
    public QRCodeTicketWeixinResult parseResult(String respStr) {
        QRCodeTicketWeixinResult result = JSON.parseObject(respStr, QRCodeTicketWeixinResult.class);
        checkResult(result);
        return result;
    }

    @Override
    public HttpMethodEnum httpMethod() {
        return HttpMethodEnum.SSL_POST;
    }

    @Override
    public String requestData() {
        return body;
    }

    public String getAccess_token() {
        return access_token;
    }

    public void setAccess_token(String access_token) {
        this.access_token = access_token;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }
}